home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / chatsrvr / srvrdoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  1.8 KB  |  71 lines

  1. // srvrdoc.h : interface of the CServerDoc class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1999 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "lstnsock.h"
  14. #include "clntsock.h"
  15.  
  16.  
  17. class CMsg;
  18.  
  19. class CServerDoc : public CDocument
  20. {
  21. protected: // create from serialization only
  22.     CServerDoc();
  23.     DECLARE_DYNCREATE(CServerDoc)
  24.  
  25. // Attributes
  26. public:
  27.     CListeningSocket* m_pSocket;
  28.     CStringList m_msgList;
  29.     CPtrList m_connectionList;
  30.  
  31. // Operations
  32. public:
  33.     void UpdateClients();
  34.     void ProcessPendingAccept();
  35.     void ProcessPendingRead(CClientSocket* pSocket);
  36.     CMsg* AssembleMsg(CClientSocket* pSocket);
  37.     CMsg* ReadMsg(CClientSocket* pSocket);
  38.     void SendMsg(CClientSocket* pSocket, CMsg* pMsg);
  39.     void CloseSocket(CClientSocket* pSocket);
  40.     void Message(LPCTSTR lpszMessage);
  41.         
  42. // Overrides
  43.     // ClassWizard generated virtual function overrides
  44.     //{{AFX_VIRTUAL(CServerDoc)
  45.     public:
  46.     virtual BOOL OnNewDocument();
  47.     virtual void DeleteContents();
  48.     //}}AFX_VIRTUAL
  49.  
  50. // Implementation
  51. public:
  52.     virtual ~CServerDoc();
  53.     virtual void Serialize(CArchive& ar);   // overridden for document i/o
  54. #ifdef _DEBUG
  55.     virtual void AssertValid() const;
  56.     virtual void Dump(CDumpContext& dc) const;
  57. #endif
  58.  
  59. protected:
  60.  
  61. // Generated message map functions
  62. protected:
  63.     //{{AFX_MSG(CServerDoc)
  64.     //}}AFX_MSG
  65.     afx_msg void OnUpdateMessages(CCmdUI* pCmdUI);
  66.     afx_msg void OnUpdateConnections(CCmdUI* pCmdUI);
  67.     DECLARE_MESSAGE_MAP()
  68. };
  69.  
  70. /////////////////////////////////////////////////////////////////////////////
  71.